﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using GolfLeague.Models;

namespace GolfLeague.EditModels
{
    public class RoundsBatchModel
    {

        #region Batch Option Variables

        [Display(Name = "Number of Rounds")]
        public int NumberOfRounds { get; set; }
        
        [Display(Name = "Start Date")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
        public DateTime StartDate { get; set; }

        [Display(Name = "Start Time")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:t}")]
        public DateTime StartTime { get; set; }

        [Display(Name = "Offset (in minutes)")]
        public int MatchOffset { get; set; }
        
        [Display(Name = "Frequency")]
        public int Frequency { get; set; }
        
        [Display(Name = "Teams")]
        public List<int> SelectedTeams { get; set; }

        [Display(Name = "Starting Side")]
        public int StartingSide { get; set; }

        [Display(Name = "Tee Box")]
        public int TeeBoxID { get; set; }

        [Display(Name = "Course")]
        public int CourseID { get; set; }

        public IEnumerable<StandardDropdown> TeamList { get; set; }
        public List<StandardDropdown> FrequencyDropDown { get; set; }
        public List<int> RoundScoringMethods { get; set; }
        public bool CreateMatches { get; set; }
               
        #endregion

        public RoundsBatchModel()
        {
            //NewDate.RoundDate = DateTime.Now;
            CreateMatches = false;
            StartDate = DateTime.Now;
            StartTime = new DateTime(StartDate.Year, StartDate.Month, StartDate.Day, 16, 0, 0);
            MatchOffset = 8;
            FrequencyDropDown = new List<StandardDropdown>(3);
            FrequencyDropDown.Add(new StandardDropdown { dropdownID = 1, dropdownText = "Weekly" });
            FrequencyDropDown.Add(new StandardDropdown { dropdownID = 2, dropdownText = "Bi-Weekly" });
            FrequencyDropDown.Add(new StandardDropdown { dropdownID = 4, dropdownText = "Monthly (4 Weeks)" });
        }
    }
}